<%
	c.cssFiles.append('/css/login/login.css')
%>
<script type="text/javascript">
function validateMobile(){
	var mobile = $("#form_forgetpassword #fg_input_mobile").val();
	if (!isValidMobile(mobile)) return false;
	return true;
}
$(document).ready(function(){
	$("#form_forgetpassword").validationEngine();
	$("#button_continue").click(function(){
		$.validationEngine.submitValidation("#form_forgetpassword"); 
		var obj = this;
		var mobile = $("#form_forgetpassword #fg_input_mobile").val();
		if (!isValidMobile(mobile)) return;
		$.validationEngine.buildPrompt("#form_forgetpassword #button_continue", "正在提交请求，请稍候。", "load");
		$.get("/login/resetPassword", {mobile : mobile}, function(data){
			if (data == "too fast"){
				$.validationEngine.closePrompt("#form_forgetpassword #button_continue");
				$.validationEngine.buildPrompt("#form_forgetpassword #button_continue", "您的提交过于频繁，请稍候尝试。", "error");
			}  else if (data == "unregistered user"){
				$.validationEngine.closePrompt("#form_forgetpassword #button_continue");
				$.validationEngine.buildPrompt("#form_forgetpassword #login_input_mobile", "您输入的手机号未在本网站注册，请重新输入。", "error");
			}  else if (data == "success"){
				$.validationEngine.buildPrompt("#form_forgetpassword #button_continue", "您的密码已重置，请检查您的139邮箱。", "pass");
				setTimeout("window.location = '/login';", 2000);
			}  else {
				$.validationEngine.closePrompt("#form_forgetpassword #button_continue");
				$.validationEngine.buildPrompt("#form_forgetpassword #button_continue", "请求失败。", "error");
			}  
		});
	});
});
</script>
<div id="login_bound">
	<h1>密码找回</h1>
	<div class="page_column_left_padding15">
		<div class="top"></div>
		<div class="content">
			<form id="form_forgetpassword">
				<div id="fg_mobile">
					<label>手机号</label>
					<input id="fg_input_mobile" type="text" name="mobile" class="validate[required,funcCall[validateMobile]]"></input>
				</div>
				<div id="bottom_buttons" style="clear:both;">
					<div id="button_continue" style="cursor:pointer;float:right;width:140px;height:35px;background:url('/image/global/continue_button.gif') no-repeat scroll 0 0 transparent;"></div>
				</div>
			</form>
		</div>
		<div class="bottom"></div>
	</div>
	<div class="page_column_right_padding_left30">
		<h2>如何才能找回我的密码？</h2>
		<p>为了您的安全，您的密码不会以明文的形式在服务器上保存，因此，在您选择“找回密码”后，我们将<strong>重置</strong>您的密码，并将重置后的密码发送至您的139邮箱。</p>
		<p>您只需要填入您的手机号即可重置密码。</p>
		<p>在获取重置后的密码后，<strong>请您及时修改密码</strong>。您可以在您的个人设置页面修改您的密码。</p>
	</div>
</div>
